home *** CD-ROM | disk | FTP | other *** search
- /*
- * file: Qwertytunes.h
- *
- * started 12 January 1992 16:45
- * david van brink
- *
- * A starting point for BigEasy programs
- *
- */
-
- /*--------------------------
- Inclusions
- --------------------------*/
-
- #include <Files.h>
-
- /*--------------------------
- Structures
- --------------------------*/
-
- #define kDocVersion 1
-
- #define kKeyRows 4
- #define kKeyColumns 10
- #define kKeyCount (kKeyRows * kKeyColumns)
-
- #define kControllerCount 3
- #define kMaxPortCount 32 /* the most ports to list in the menu */
-
- typedef enum
- {
- eFirstField,
- eKeyField,
- ePitchField,
- eVelField,
- eLastField
- };
-
- typedef struct
- {
- long channel;
- short pitch[kKeyCount];
- short vel[kKeyCount];
- short dur[kKeyCount]; /* in milliseconds */
- Boolean zoomed;
- Boolean backgroundPlay;
-
- short portCount;
- OSType clientList[kMaxPortCount];
- OSType portList[kMaxPortCount];
-
- } TPartialSaveRecord;
-
-
- typedef struct
- {
- Boolean used;
-
- Boolean everSaved;
- Boolean changed;
- Boolean littleChanged;
-
- FSSpec docSpec;
- TPartialSaveRecord sr;
-
- long instrument;
-
- OSType outPortID;
- short outPort; /* MIDI output port */
- Boolean keyPosition[kKeyCount]; /* boolean array, compare to global one */
- short selectedKey;
- short tabField; /* which field gets entered with numbers */
- Point textCursorPt; /* my fake inserstion point */
- Boolean textCursorBlink;
- short textCursorPhase; /* 1 if visible, 0 if not */
- long textCursorTicks;
- WindowPtr w;
- } TDoc;
-
- typedef struct
- {
- long docVersion; /* quick check that we can really open the file */
- Rect windowRect;
- TPartialSaveRecord sr;
- } TSaveRecord;
-
-
- /*--------------------------*/
-
- typedef struct
- {
- Rect keyRect[kKeyCount];
- Rect controllerRect[kControllerCount];
- Rect allKeyRect;
- Rect keyInfoRect;
- Rect pitchInfoRect;
- Rect velInfoRect;
-
- char keyCodeToKeyPosition[256];
- Rect unzoomedBounds;
- Rect zoomedBounds;
-
- char keyMask[16];
- Boolean keyPosition[kKeyCount]; /* boolean array */
- short lastKeyDown; /* in keyposition */
-
- OSType midiClientID;
- OSType timePortID;
- short timePort;
-
- short portCount; /* count of ports we might connect to */
- OSType clientList[kMaxPortCount];
- OSType portList[kMaxPortCount];
- Str255 portName[kMaxPortCount];
-
- TDoc *thisDoc;
- } TGlobals;
-
-
- /*--------------------------
- Variables
- --------------------------*/
-
- #ifdef globals
- #define VAR
- #else
- #define VAR extern
- #endif
-
- #define kFirstDocWindow 1
- #define kDocMax 1
- VAR TDoc gDoc[kDocMax];
- VAR short gDocCount;
-
- VAR TGlobals *g;
-
- #undef VAR
-
-
- /*--------------------------
- Prototypes
- --------------------------*/
-
- void ActivateDoc(short n);
- void DeactivateDoc(short n);
-
- void NewDocFromSaveRecord(short docNumber,TSaveRecord *sr);
- void FixUpMenus(TDoc *d);
- void FixUpDocConnectionList(TDoc *d);
-